{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 44,
   "metadata": {},
   "outputs": [],
   "source": [
    "\"\"\" 获取PDF表格中的数据 \"\"\"\n",
    "# 导入必要库\n",
    "import pdfplumber\n",
    "import pandas as pd"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 45,
   "metadata": {},
   "outputs": [],
   "source": [
    "pdf = pdfplumber.open(R'data\\2022comdesigngamelist.pdf')\n",
    "# first_page = pdf.pages[1]\n",
    "# table1 = first_page.extract_table()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 46,
   "metadata": {},
   "outputs": [],
   "source": [
    "table = []\n",
    "for i in range(len(pdf.pages)):\n",
    "    if(i+1)<len(pdf.pages):\n",
    "      page = pdf.pages[i + 1]\n",
    "      table.extend(page.extract_table())\n",
    "\n",
    "# print(table)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 47,
   "metadata": {},
   "outputs": [],
   "source": [
    "pd.DataFrame(table,columns=('学校','项目名称','大类','参赛学生','指导教师')).to_csv('2022年西北赛区推送国赛名单.csv',)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 48,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = 西北赛区推送国赛名单表 = pd.DataFrame(table,columns=('学校','项目名称','大类','参赛学生','指导教师'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 49,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,\n",
       "        13,  14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,\n",
       "        26,  27,  28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,\n",
       "        39,  40,  41,  42,  43,  44,  45,  46,  47,  48,  49,  50,  51,\n",
       "        52,  53,  54,  55,  56,  57,  58,  59,  60,  61,  62,  63,  64,\n",
       "        65,  66,  67,  68,  69,  70,  71,  72,  73,  74,  75,  76,  77,\n",
       "        78,  79,  80,  81,  82,  83,  84,  85,  86,  87,  88,  89,  90,\n",
       "        91,  92,  93,  94,  95,  96,  97,  98,  99, 100, 101, 102, 103,\n",
       "       104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,\n",
       "       117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129,\n",
       "       130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142,\n",
       "       143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,\n",
       "       156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167, 168,\n",
       "       169, 170, 171, 172, 173, 174, 175, 176, 177, 178, 179, 180, 181,\n",
       "       182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194,\n",
       "       195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207,\n",
       "       208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220,\n",
       "       221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233,\n",
       "       234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246,\n",
       "       247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259,\n",
       "       260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272,\n",
       "       273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285,\n",
       "       286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298,\n",
       "       299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,\n",
       "       312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,\n",
       "       325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337,\n",
       "       338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350,\n",
       "       351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n",
       "       364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376,\n",
       "       377, 378, 379, 380, 381, 382, 383, 384, 385, 386, 387, 388, 389,\n",
       "       390, 391, 392, 393, 394, 395, 396, 397, 398, 399, 400, 401, 402,\n",
       "       403, 404, 405, 406, 407, 408, 409, 410, 411, 412, 413, 414, 415,\n",
       "       416, 417, 418, 419, 420, 421, 422, 423, 424, 425, 426, 427, 428,\n",
       "       429, 430, 431, 432, 433, 434, 435, 436, 437, 438, 439, 440, 441,\n",
       "       442, 443, 444, 445, 446, 447, 448, 449, 450, 451, 452, 453, 454,\n",
       "       455, 456, 457, 458, 459, 460, 461, 462, 463, 464, 465, 466, 467,\n",
       "       468, 469, 470, 471, 472, 473, 474, 475, 476, 477, 478, 479, 480,\n",
       "       481, 482, 483, 484, 485, 486, 487], dtype=int64)"
      ]
     },
     "execution_count": 49,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "\"\"\" 获取df行索引值 \"\"\"\n",
    "df.index.values"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 50,
   "metadata": {},
   "outputs": [],
   "source": [
    "c = df['学校'].value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 51,
   "metadata": {},
   "outputs": [],
   "source": [
    "c = 西北赛区推送国赛名单表.学校.value_counts()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 52,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "学校               陇东学院\n",
       "项目名称         小智实验教学平台\n",
       "大类            微课与教学辅助\n",
       "参赛学生    谢燕梅  温小晴  赵世界\n",
       "指导教师          曹亮  聂丽霞\n",
       "Name: 100, dtype: object"
      ]
     },
     "execution_count": 52,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[100]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'微课与教学辅助'"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.iloc[100,2]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>基于分时控制的森林安全防护多步态机器人</td>\n",
       "      <td>人工智能应用</td>\n",
       "      <td>范开裕  房旭  赵雨竹</td>\n",
       "      <td>王欢</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《文化的记忆：汉字历史数字化交互馆》</td>\n",
       "      <td>数媒游戏与交互设计专业组</td>\n",
       "      <td>陈王兴  刘睿悦  刘雅婷</td>\n",
       "      <td>刘洋  张志腾</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校                 项目名称            大类           参赛学生     指导教师\n",
       "1    宝鸡文理学院  基于分时控制的森林安全防护多步态机器人        人工智能应用   范开裕  房旭  赵雨竹       王欢\n",
       "400  西北民族大学   《文化的记忆：汉字历史数字化交互馆》  数媒游戏与交互设计专业组  陈王兴  刘睿悦  刘雅婷  刘洋  张志腾"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[[1,400]]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "str"
      ]
     },
     "execution_count": 55,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df.iloc[100,2])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>基于AI的固沙多功能扎草生态机器人</td>\n",
       "      <td>人工智能应用</td>\n",
       "      <td>张桦  都娜娜  粟建翔</td>\n",
       "      <td>胡静波</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>基于分时控制的森林安全防护多步态机器人</td>\n",
       "      <td>人工智能应用</td>\n",
       "      <td>范开裕  房旭  赵雨竹</td>\n",
       "      <td>王欢</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>基于机械视觉的分类和处理垃圾桶的设计</td>\n",
       "      <td>物联网应用</td>\n",
       "      <td>王俊豪  王旭  罗益</td>\n",
       "      <td>周新淳  钱郁</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>e家居--基于物联网的智能房车控制系统</td>\n",
       "      <td>物联网应用</td>\n",
       "      <td>刘楠  孙龙桥  冯新洋</td>\n",
       "      <td>张磊</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>甘肃民族师范学院</td>\n",
       "      <td>初中化学四大基本反应的讲解</td>\n",
       "      <td>微课与教学辅助</td>\n",
       "      <td>王强  李彦武  张丽丽</td>\n",
       "      <td>县小平  张明文</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>甘肃农业大学</td>\n",
       "      <td>紫花首蓿病害识别与防治信息系统</td>\n",
       "      <td>软件应用与开发</td>\n",
       "      <td>蔺博  冉晓蕊  徐智超</td>\n",
       "      <td>李宇泊  黄登基</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校                 项目名称       大类          参赛学生      指导教师\n",
       "0    宝鸡文理学院    基于AI的固沙多功能扎草生态机器人   人工智能应用  张桦  都娜娜  粟建翔       胡静波\n",
       "1    宝鸡文理学院  基于分时控制的森林安全防护多步态机器人   人工智能应用  范开裕  房旭  赵雨竹        王欢\n",
       "2    宝鸡文理学院   基于机械视觉的分类和处理垃圾桶的设计    物联网应用   王俊豪  王旭  罗益   周新淳  钱郁\n",
       "3    宝鸡文理学院  e家居--基于物联网的智能房车控制系统    物联网应用  刘楠  孙龙桥  冯新洋        张磊\n",
       "4  甘肃民族师范学院        初中化学四大基本反应的讲解  微课与教学辅助  王强  李彦武  张丽丽  县小平  张明文\n",
       "5    甘肃农业大学      紫花首蓿病害识别与防治信息系统  软件应用与开发  蔺博  冉晓蕊  徐智超  李宇泊  黄登基"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[0:5]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "pandas.core.series.Series"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "type(df.loc[0])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>宝鸡文理学院</td>\n",
       "      <td>基于分时控制的森林安全防护多步态机器人</td>\n",
       "      <td>人工智能应用</td>\n",
       "      <td>范开裕  房旭  赵雨竹</td>\n",
       "      <td>王欢</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "       学校                 项目名称      大类          参赛学生 指导教师\n",
       "1  宝鸡文理学院  基于分时控制的森林安全防护多步态机器人  人工智能应用  范开裕  房旭  赵雨竹   王欢"
      ]
     },
     "execution_count": 58,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "ls1 = [False] * 488\n",
    "ls1[1] = True\n",
    "df.loc[ls1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 59,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>409</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《马家窑文化彩陶信息可视化设计》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张金星  赵紫琪</td>\n",
       "      <td>李文丽  李君利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>410</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《兰州野生动物园信息可视化》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王艺霏  乌日娜  陈强</td>\n",
       "      <td>李文丽  李瑾</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校              项目名称       大类          参赛学生      指导教师\n",
       "409  西北民族大学  《马家窑文化彩陶信息可视化设计》  信息可视化设计      张金星  赵紫琪  李文丽  李君利\n",
       "410  西北民族大学    《兰州野生动物园信息可视化》  信息可视化设计  王艺霏  乌日娜  陈强   李文丽  李瑾"
      ]
     },
     "execution_count": 59,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "筛选条件1 = df.学校 == \"西北民族大学\"\n",
    "筛选条件2 = df.大类 == \"信息可视化设计\"\n",
    "筛选条件 = 筛选条件1 & 筛选条件2\n",
    "df.loc[筛选条件]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 60,
   "metadata": {},
   "outputs": [],
   "source": [
    "def condition(df):\n",
    "    \"\"\" 筛选条件函数 \"\"\"\n",
    "    筛选条件1 = df.学校 == \"西北民族大学\"\n",
    "    筛选条件2 = df.大类 == \"信息可视化设计\"\n",
    "    筛选条件 = 筛选条件1 & 筛选条件2\n",
    "    return 筛选条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 61,
   "metadata": {},
   "outputs": [],
   "source": [
    "def 是否专业组(x):\n",
    "    if \"专业组\" in x:\n",
    "        return True\n",
    "    else:\n",
    "        return False"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 62,
   "metadata": {},
   "outputs": [],
   "source": [
    "def condition(df):\n",
    "    \"\"\" 筛选条件函数 \"\"\"\n",
    "    筛选条件1 = df.学校 == \"西北民族大学\"\n",
    "    筛选条件2 = df.大类.apply(是否专业组)\n",
    "    筛选条件 = 筛选条件1 & 筛选条件2\n",
    "    return 筛选条件"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 63,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>400</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《文化的记忆：汉字历史数字化交互馆》</td>\n",
       "      <td>数媒游戏与交互设计专业组</td>\n",
       "      <td>陈王兴  刘睿悦  刘雅婷</td>\n",
       "      <td>刘洋  张志腾</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>401</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《汉衍书意-汉字发展历史数字化交互云展厅》</td>\n",
       "      <td>数媒游戏与交互设计专业组</td>\n",
       "      <td>杨娟  钱鑫  廖美琳  白舒怡  李林书</td>\n",
       "      <td>张志腾  冷明伟</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>402</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《声声慢》</td>\n",
       "      <td>数媒游戏与交互设计专业组</td>\n",
       "      <td>张紫淇  鲁淏文  陈丹芬</td>\n",
       "      <td>杨志宏</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>404</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《中华传统文化五行之属》</td>\n",
       "      <td>数媒静态设计专业组</td>\n",
       "      <td>文宣  徐慧子  庞靖</td>\n",
       "      <td>李文丽  李瑾</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>405</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《汉字的魅力—四季之美》</td>\n",
       "      <td>数媒静态设计专业组</td>\n",
       "      <td>万晋妤  彭键</td>\n",
       "      <td>李文丽  李瑾</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>406</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《汉字溢彩传经典，一撇一捺总关情》</td>\n",
       "      <td>数媒静态设计专业组</td>\n",
       "      <td>艾力飞热·艾尼玩  西仁娜依·阿布来克  仲格尔吉</td>\n",
       "      <td>刘舒雯</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>408</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《石榴花开的声音》</td>\n",
       "      <td>数媒动漫与短片专业组</td>\n",
       "      <td>王宝国  林焮婷  马念  张衍鹏  高巧灵</td>\n",
       "      <td>张辉刚</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校                   项目名称            大类                       参赛学生  \\\n",
       "400  西北民族大学     《文化的记忆：汉字历史数字化交互馆》  数媒游戏与交互设计专业组              陈王兴  刘睿悦  刘雅婷   \n",
       "401  西北民族大学  《汉衍书意-汉字发展历史数字化交互云展厅》  数媒游戏与交互设计专业组      杨娟  钱鑫  廖美琳  白舒怡  李林书   \n",
       "402  西北民族大学                  《声声慢》  数媒游戏与交互设计专业组              张紫淇  鲁淏文  陈丹芬   \n",
       "404  西北民族大学           《中华传统文化五行之属》     数媒静态设计专业组                文宣  徐慧子  庞靖   \n",
       "405  西北民族大学           《汉字的魅力—四季之美》     数媒静态设计专业组                    万晋妤  彭键   \n",
       "406  西北民族大学      《汉字溢彩传经典，一撇一捺总关情》     数媒静态设计专业组  艾力飞热·艾尼玩  西仁娜依·阿布来克  仲格尔吉   \n",
       "408  西北民族大学              《石榴花开的声音》    数媒动漫与短片专业组     王宝国  林焮婷  马念  张衍鹏  高巧灵   \n",
       "\n",
       "         指导教师  \n",
       "400   刘洋  张志腾  \n",
       "401  张志腾  冷明伟  \n",
       "402       杨志宏  \n",
       "404   李文丽  李瑾  \n",
       "405   李文丽  李瑾  \n",
       "406       刘舒雯  \n",
       "408       张辉刚  "
      ]
     },
     "execution_count": 63,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.loc[condition]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 64,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>学校</th>\n",
       "      <th>项目名称</th>\n",
       "      <th>大类</th>\n",
       "      <th>参赛学生</th>\n",
       "      <th>指导教师</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>409</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《马家窑文化彩陶信息可视化设计》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>张金星  赵紫琪</td>\n",
       "      <td>李文丽  李君利</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>410</th>\n",
       "      <td>西北民族大学</td>\n",
       "      <td>《兰州野生动物园信息可视化》</td>\n",
       "      <td>信息可视化设计</td>\n",
       "      <td>王艺霏  乌日娜  陈强</td>\n",
       "      <td>李文丽  李瑾</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "         学校              项目名称       大类          参赛学生      指导教师\n",
       "409  西北民族大学  《马家窑文化彩陶信息可视化设计》  信息可视化设计      张金星  赵紫琪  李文丽  李君利\n",
       "410  西北民族大学    《兰州野生动物园信息可视化》  信息可视化设计  王艺霏  乌日娜  陈强   李文丽  李瑾"
      ]
     },
     "execution_count": 64,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df.query('学校==\"西北民族大学\" and 大类==\"信息可视化设计\"')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.10 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "9650cb4e16cdd4a8e8e2d128bf38d875813998db22a3c986335f89e0cb4d7bb2"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
